package com.itheima.super_keyword;

import org.w3c.dom.ls.LSOutput;

class Fu {
    protected int num = 10;

    public void method1() {
        System.out.println("父类 Method1方法");
    }

    public Fu() {
        System.out.println("父类 空参构造");
    }

    public Fu(int num) {
        this.num = num;
        System.out.println("父类 有参构造");
    }
}

class Zi extends Fu {
    private int num = 20;

    public void show() {
        int num = 30;
        System.out.println("局部变量num:" + num);
        System.out.println("本类的成员变量num:" + this.num);
        System.out.println("父类的成员变量num:" + super.num);
    }

    @Override
    public void method1() {
        super.method1();
        System.out.println("子类 Method1方法");
    }
    public Zi(){
        super(10);
    }
    public Zi(int num){
        super(10);
        this.num = num;
    }
}

public class Test1 {
    /*
    super 访问父类的，this访问本类
     */
    public static void main(String[] args) {
        Zi z = new Zi(10);
       // z.show();
       // z.method1();
    }
}
